package io.renren.modules.sp.dao;

import io.renren.common.dao.BaseDao;
import io.renren.modules.sp.dto.SpMatchItemTeamUserDTO;
import io.renren.modules.sp.entity.SpMatchEntity;
import io.renren.modules.sp.entity.SpMatchItemTeamUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import cn.hutool.db.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.util.List;
import java.util.Map;

/**
* 参赛成员
*
* @author whc 15953295779@126.com
* @since 3.0 2023-04-21
*/
@Mapper
public interface SpMatchItemTeamUserDao extends BaseDao<SpMatchItemTeamUserEntity> {
    IPage<SpMatchItemTeamUserEntity> selectPageVo(Page page, @Param(Constants.WRAPPER) QueryWrapper<SpMatchItemTeamUserDTO>  wrapper);

    List<Map<String,Object>> queryUserItems(Long userId, Long matchId);

    Map<String,Object> queryUserByTicket(String ticket);

    Map<String,Object> queryMatchInfo(String matchId);

    Map<String,Object> queryMatchInfoByTeam(String teamId);

    int checkUserMatch(@Param("userId") Long userId, @Param("matchId") Integer matchId ,@Param("baseMatchItemId")Long baseMatchItemId);

    List<Map<String, Object>> findAwardStatisticsByMatchId(@Param(Constants.WRAPPER) Map<String,Object> param);
}
